/**
 *    @file       argument.h
 *
 *    @brief      
 *    @details
 *
 *    @version    1.0
 *    @date       02/14/2014 10:32:43 AM
 *
 *    @author     Theophilus (), wangtf418@gmail.com 
 */
#ifndef _SF_ARGUMENT_H_
#define _SF_ARGUMENT_H_
#include "srvdef.h"
#include "sockbase.h"

struct comargs
{
public:
	comargs()
	{

	}

	virtual ~comargs()
	{

	}

public:
	virtual comargs * clone() const = 0;
};

struct srv_addr_args : public comargs
{
	bf_uint_t m_srvip;	
	bf_ushort_t m_srvport;

	comargs * clone() const
	{
		srv_addr_args *args = new srv_addr_args;
		args->m_srvip = m_srvip;
		args->m_srvport = m_srvport;
		return args;
	}
};

struct client_addr_args : public comargs
{
	bf_uint_t m_srvip;	
	bf_ushort_t m_srvport;

	bf_uint32_t m_thd_type;
	bf_uint32_t m_thd_index;
	bf_uint64_t m_tsk_id;

	bf_uint_t m_sequence_num;

	comargs * clone() const
	{
		client_addr_args *args = new client_addr_args;
		args->m_srvip = m_srvip;
		args->m_srvport = m_srvport;
		args->m_thd_type = m_thd_type;
		args->m_thd_index = m_thd_index;
		args->m_tsk_id = m_tsk_id;
		args->m_sequence_num = m_sequence_num;
		return args;
	}
};

struct srv_socket_args : public comargs
{
	csocket *m_socket;
	comargs * clone() const
	{
		srv_socket_args *args = new srv_socket_args;
		args->m_socket = m_socket;
		return args;
	}
};

#endif

